home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 42
/
Amiga Format AFCD42 (Issue 126, Aug 1999).iso
/
-serious-
/
programming
/
other
/
jikes
/
src
/
configure.in
< prev
next >
Wrap
Text File
|
1999-05-14
|
9KB
|
316 lines
# $Id: configure.in,v 1.1 1999/03/09 14:49:41 shields Exp $
dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run to configure the
dnl Makefile in this directory.
AC_INIT(jikes.cpp)
#--------------------------------------------------------------------
# Version identification info
#--------------------------------------------------------------------
JIKES_VERSION=0.46
# Convert srcdir into full path name
srcdir=`cd $srcdir ; pwd`
echo "srcdir is $srcdir"
#--------------------------------------------------------------------
# see if --with-jikespg location is given on the command line
#--------------------------------------------------------------------
AC_ARG_WITH(jikespg, [ --with-jikespg=PROG location of jikes parser generator (optional)],
JIKESPG=$withval, JIKESPG=NONE)
if test "$JIKESPG" != "NONE"; then
if test ! -f "$JIKESPG" || test ! -x "$JIKESPG"; then
AC_MSG_ERROR([jikespg argument '$JIKESPG' is not a file or is not executable])
fi
else
JIKESPG=jikespg
fi
#--------------------------------------------------------------------
# see if --with-icc is given on the command line
#--------------------------------------------------------------------
AC_ARG_WITH(icc, [ --with-icc=PROG use the IBM Cset++ compiler, optional PROG can be given instead of searching on the PATH],
CC=$withval, CC=NONE)
if test "$CC" != "NONE"; then
if test "$CC" = yes; then
AC_PATH_PROG(CC, icc)
if test "$CC" = ""; then
AC_PATH_PROG(CC, xlC)
if test "$CC" = ""; then
AC_MSG_ERROR([could not find icc or xlC on your PATH.])
fi
fi
fi
if test ! -f "$CC" || test ! -x "$CC"; then
AC_MSG_ERROR([argument '$CC' is not a file or is not executable])
fi
CC_NAME=icc
CCREQUIREDFLAGS="-c -DICC"
CCOPTFLAGS="-O2"
CCDEBUGFLAGS="-DTEST"
LD=$CC
LDDEBUGFLAGS="-g"
LDFLAGS='-L. -o $(EXECUTABLE)'
fi
#--------------------------------------------------------------------
# see if --with-CC is given on the command line
#--------------------------------------------------------------------
AC_ARG_WITH(CC, [ --with-CC=PROG use the AT&T CC compiler, optional PROG can be given instead of searching on the PATH],
CC=$withval, CC=NONE)
if test "$CC" != "NONE"; then
if test "$CC" = yes; then
AC_PATH_PROG(CC, CC)
if test "$CC" = ""; then
AC_MSG_ERROR([could not find CC on your PATH.])
fi
fi
if test ! -f "$CC" || test ! -x "$CC"; then
AC_MSG_ERROR([argument '$CC' is not a file or is not executable])
fi
CC_NAME=CC
CCREQUIREDFLAGS="-c -ansi"
CCOPTFLAGS="-fast"
CCDEBUGFLAGS="-DTEST -g -xs"
LD=$CC
LDDEBUGFLAGS="-g"
LDFLAGS='-L. -o $(EXECUTABLE)'
fi
#
# If no other compiler was given as a --with option then we use g++
#
if test "$CC_NAME" = ""; then
AC_PATH_PROG(CC, g++)
if test "$CC" = ""; then
AC_MSG_ERROR([could not find g++ on your PATH.])
fi
if test ! -f "$CC" || test ! -x "$CC"; then
AC_MSG_ERROR([argument '$CC' is not a file or is not executable])
fi
CC_NAME=g++
CCREQUIREDFLAGS="-c -DTYPE_bool -ansi"
CCOPTFLAGS="-O2"
CCDEBUGFLAGS="-DTEST -g"
LD=$CC
LDDEBUGFLAGS="-g"
LDFLAGS='-L. -o $(EXECUTABLE)'
fi
#--------------------------------------------------------------------
# see if --with-gas is given on the command line
#--------------------------------------------------------------------
AC_ARG_WITH(gas, [ --with-gas use the gnu assembler (optional)],
GAS=$withval, GAS=no)
if test "$GAS" = yes; then
if test ! "$CC" = g++; then
AC_MSG_ERROR([gnu assembler can only be used with g++.])
fi
CCREQUIREDFLAGS="$CCREQUIREDFLAGS -mgas"
fi
# echo the compiler we are using
AC_MSG_CHECKING([for the compiler to use])
AC_MSG_RESULT([$CC.])
# defaults under UNIX
ERASE="rm -f"
O=o
EXECUTABLE=jikes
# Figure out what platform we are running on so that we know
# what flags to give to the compiler
# Keep case statements in alphabetical order.
case "`uname -s`" in
AIX)
if test $CC_NAME = icc; then
CCREQUIREDFLAGS="$CCREQUIREDFLAGS -langlvl=ansi -qnotempinc -+ -qinlglue"
CCDEBUGFLAGS="$CCDEBUGFLAGS -g"
fi
CCREQUIREDFLAGS="$CCREQUIREDFLAGS -DUNIX -DBIGENDIAN"
LDFLAGS="$LDFLAGS $LDDEBUGFLAGS"
;;
FreeBSD)
CCREQUIREDFLAGS="$CCREQUIREDFLAGS -DUNIX -DGNU_LIBC5 -DNO_WCHAR_H"
if test $CC_NAME = "g++"; then
CCREQUIREDFLAGS="-funsigned-char $CCREQUIREDFLAGS"
fi
# FreeBSD doesn't have the wchar.h functions yet
CCREQUIREDFLAGS="$CCREQUIREDFLAGS -DGNU_LIBC5 -DNO_WCHAR_H"
# Check byte-order
case "`uname -m`" in
alpha)
;;
i?86)
;;
*)
AC_MSG_ERROR([FreeBSD arch '`uname -m`' not supported.])
;;
esac
;;
HP-UX)
if test $CC_NAME = g++; then
CCREQUIREDFLAGS="-funsigned-char $CCREQUIREDFLAGS"
fi
CCREQUIREDFLAGS="$CCREQUIREDFLAGS -DUNIX -D_INCLUDE_POSIX_SOURCE"
CCREQUIREDFLAGS="$CCREQUIREDFLAGS -DSTAT_POSIX_1"
LDFLAGS="$LDDEBUGFLAGS $LDFLAGS -lstdc++"
;;
IRIX)
CCREQUIREDFLAGS="$CCREQUIREDFLAGS -DUNIX -DBIGENDIAN"
if test ! $GAS = yes; then
CCREQUIREDFLAGS="$CCREQUIREDFLAGS -mmips-as"
fi
;;
Linux)
CCREQUIREDFLAGS="$CCREQUIREDFLAGS -DUNIX"
if test $CC_NAME = "g++"; then
CCREQUIREDFLAGS="-funsigned-char $CCREQUIREDFLAGS"
fi
case "`uname -m`" in
alpha)
;;
i?86)
;;
ppc)
CCREQUIREDFLAGS="$CCREQUIREDFLAGS -DBIGENDIAN"
;;
sparc)
CCREQUIREDFLAGS="$CCREQUIREDFLAGS -DBIGENDIAN"
;;
*)
AC_MSG_ERROR([Linux arch '`uname -m`' not supported.])
;;
esac
# test to see if we are using libc5 or gnulib5 (libc6)
if test -f /lib/libc.so.5 && test ! -f /lib/libc.so.6; then
CCREQUIREDFLAGS="$CCREQUIREDFLAGS -DGNU_LIBC5"
else
CCREQUIREDFLAGS="$CCREQUIREDFLAGS -DSTAT_POSIX"
fi
;;
OS2)
if test $CC_NAME = icc; then
O=obj
CCREQUIREDFLAGS="-Tdp -G5 $CCREQUIREDFLAGS -DUNIX_FILE_SYSTEM -Dcerr=cout"
CCOPTFLAGS="$CCOPTFLAGS -Tdp -O -DNDEBUG"
CCDEBUGFLAGS="$CCDEBUGFLAGS -Ti"
LDDEBUGFLAGS="/Ti+"
LDFLAGS="$LDFLAGS /O:\$(EXECUTABLE) /PM:VIO /STACK:400000 /NOE"
# link to an obj file in the icc directory
TMP=$CC
TMP=`dirname $TMP`
TMP=`dirname $TMP`
SYSOBJECTS="$TMP\\lib\\setargv.obj"
fi
;;
OSF1)
CCREQUIREDFLAGS="$CCREQUIREDFLAGS -DUNIX"
;;
SunOS)
CCREQUIREDFLAGS="$CCREQUIREDFLAGS -DUNIX -DBIGENDIAN"
case "$CC_NAME" in
g++)
CCREQUIREDFLAGS="-funsigned-char $CCREQUIREDFLAGS"
;;
icc)
CCREQUIREDFLAGS="-langlvl=ansi -+ -qnotempinc $CCREQUIREDFLAGS"
CCOPTFLAGS="$CCOPTFLAGS -O3 -qstrict"
CCDEBUGFLAGS="$CCDEBUGFLAGS -g"
LDFLAGS="$LDFLAGS -Bstatic"
;;
esac
;;
*)
AC_MSG_ERROR([platform '`uname -s`' is not supported.])
;;
esac
#--------------------------------------------------------------------
# see if --enable-symbols was given, if so use debug symbols
#--------------------------------------------------------------------
AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols],
[DEBUG_SYMBOLS=$enableval], [DEBUG_SYMBOLS=no])
if test "$DEBUG_SYMBOLS" = "yes"; then
CCFLAGS='$(CCREQUIREDFLAGS) $(CCDEBUGFLAGS)'
else
CCFLAGS='$(CCREQUIREDFLAGS) $(CCOPTFLAGS)'
fi
# Subst variables into Makefile.in to p